﻿<!--#include file="h.asp"--><%
'
'	七色虎建站系统
'	论坛全部用户页面
'	2011.11.2

Sub main
	Dim sex,str,sexStr,body_,id,rs,sql,a,sqlExWhere,area,sqlExOrder,sort,sortStr
	Dim count,pagecount,page,i,pagesize,pagenum
	sex=getN("sex",0)
	a=getDD("a","")
	area=getD("area","")
	sort=getData("sort")
	
	Select Case sex
		Case 0:
			sqlExWhere=""
			sexStr=""
			str=hu.url("bbs_users.asp?sex=1","帅哥")&"."&hu.url("bbs_users.asp?sex=2","美女")
		Case 1:
			sqlExWhere="and sex=1"
			str= hu.url("bbs_.asp","全部")&"."&hu.url("bbs_users.asp?sex=2","美女")
			sexStr="男"
		Case 2:
			sqlExWhere="and sex=2"
			str=hu.url("bbs_users.asp","全部")&"."&hu.url("bbs_users.asp?sex=1","帅哥")
			sexStr="女"
		Case Else:
			sqlExWhere=""
			sexStr=""
			str=hu.url("bbs_users.asp?sex=1","帅哥")&"."&hu.url("bbs_users.asp?sex=2","美女")
	End Select
	
	Select Case sort'排序
		Case ""'活跃
			sortStr="活跃."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=money","财富")&"."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=good","威望")&_
				"."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=new","新人")
			sqlExOrder="logtime desc"
		Case "money"'富豪
			sortStr=hu.url("bbs_users.asp?sex="&sex,"活跃")&".财富."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=good","威望")&_
				"."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=new","新人")
			sqlExOrder="money desc,points desc"
		Case "good"'威望
			sortStr=hu.url("bbs_users.asp?sex="&sex,"活跃")&"."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=money","财富")&".威望."&_
				hu.url("bbs_users.asp?sex="&sex&"&amp;sort=new","新人")
			sqlExOrder="hu_level desc,experience desc"
		Case "new"'新人
			sortStr=hu.url("bbs_users.asp?sex="&sex,"活跃")&"."&hu.url("bbs_users.asp?sex="&sex&"&amp;sort=money","财富")&"."&_
				hu.url("bbs_users.asp?sex="&sex&"&amp;sort=good","威望")&".新人"
			sqlExOrder="id desc"
		Case Else
			rupt "错误","错误排序"
	End Select
	pagesize=10
	page=getN("page",1)
	hu.title = "全部"&sexStr&"会员"
	body_ = checkMsg()'信息
	body_ = body_ & "[div=nav]-"&hu.url("?aid=index","首页")&"-全部"&sexStr&"会员-"& hu.url("bbs_online.asp","在线会员") &"[/div]"&_
		"[div=odd]排序:"&sortStr&"[/div]"

	Select Case a
	Case "city"'查找城市
		sqlExWhere = sqlExWhere & " and city='"&area&"'"
		body_ = body_ & "查找"&area&"的会员<br/>"
	Case "area"'查找地区(省,区,其他)
		sqlExWhere = sqlExWhere & " and city like '"&area&"-%'"
		body_ = body_ & "查找"&area&"的会员<br/>"
	End Select

	sql="select top 100 id,name,sex,remark from 74hu_user where 1 "&sqlExWhere&" order by "&sqlExOrder
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.open sql, hu.db, 1, 1
	If Not rs.eof Then
		count = rs.recordcount
		If count>=100 Then
			body_ = body_ & "超过100"
		Else
			body_ = body_ & "有"&count
		End If
		body_ = body_ & "位"&sexStr&"会员."&str&"<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
				body_ = body_ & "[div=odd]"&(pagenum+i)&"."&hu.url("bbs_user.asp?id="&rs("id"), noubb(rs("name")) )&_
					"["& getBbsSex(rs("sex")) &"][/div][div=even]"&getUserRemark(rs("remark")) &"[/div]"
			rs.movenext
		Next
		body_ = body_ & showPage("bbs_users.asp", "sex:"&sex&",a:"&a&",area:"&area, page, pagecount)
	Else
		body_ = body_ & "没有"&sexStr&"会员"&str&"<br/>"
	End If
	rs.close
	Set rs=Nothing
	hu.body = comUbb(body_)
End Sub

%>